package com.enjoy.list;

import java.util.LinkedList;
import java.util.Queue;

public class LinkedListTest {
    public static void main(String[] args) {
        // 队列
        Queue<String> queue = new LinkedList<>();
        queue.offer("aa");
        queue.offer("bb");
        queue.offer("cc");
        queue.offer("dd");
        queue.offer("ee");

        while (queue.peek() != null) {
            System.out.println("queue.poll() = " + queue.poll());
        }


        // 栈
//        Deque<String> deque = new LinkedList<>();
//
//        deque.push("aa");
//        deque.push("bb");
//        deque.push("cc");
//        deque.push("dd");
//        deque.push("ee");
//
//        while (deque.peek() != null) {
//            System.out.println("deque.pop() = " + deque.pop());
//        }
    }
}
